1. Field of the Invention
The present invention relates to a technique for optimizing a binary code in a language having access to a binary coded decimal (hereinafter referred to as BCD) variable. In particular, the present invention relates to a technique for optimizing the binary code by converting a (BCD) operation to a decimal floating point (hereinafter referred to as DFP) operation.
2. Description of the Related Art
COBOL is a high-level language born in United States in 1959, and it has a long history among various languages. Even now, the COBOL language is still used for mission critical systems (for example, mainframes) because programs for clerical work can be efficiently developed. For example, a COBOL binary code is often used on IBM (registered trademark) System z (registered trademark), a mainframe sold by International Business Machines Corporation (registered trademark).
In COBOL, when the integer type is not specified at all, a figure is shown in a zoned decimal format (also referred to as an external decimal format). In order to perform an ordinary binary operation in COBOL, a binary modifier is necessary. However, a lot of COBOL programmers do not specify anything as an integer type. Therefore, a zoned decimal format is often used in COBOL.
When COBOL is executed, the zoned decimal format is internally converted to a packed format (also referred to as an internal decimal format) each time. Therefore, significant performance deterioration and speed decrease occur.
Therefore, optimization of a source code at the time of compiling the COBOL source code has been performed in order to improve the performance deterioration and speed decrease described above. The optimization is, for example, to perform type conversion of the source code from a decimal format to binary operations.
PL/I is one of general-purpose programming languages, which was born in 1964. PL/I is widely used in mainframes of IBM (registered trademark), for example, OS/390, z/OS, IMS (Information Management System) or CICS (Customer Information Control System).
Japanese Paten Application No. 2001-34482A describes a technique capable of making it possible to generalize an optimization process in a compilation process (paragraph 0009). This technique includes converting a source program to binary-tree-format internal data and optimizing the internal data (claim 1).
Japanese Patent Application No. 2012-248139A describes a technique for optimizing a binary code in a language having access to a BCD variable (paragraph 0001). This technique includes detecting, for each variable, an area which includes access to a zoned-decimal-format variable and does not include an instruction which can cause a side effect, from the binary code; and performing, within the detected area, a process of converting the zoned-decimal-format variable to a binary type, a process of deleting such a pack/unpack code that a result of the conversion does not change even if the pack/unpack code is deleted, from the binary code; or a combination of the processes (claim 1).
Japanese Patent Application No. 2000-132404A describes an instruction sequence optimization apparatus which estimates the size of a constant to be solved as an address difference value before performing linkage (abstract).
Japanese Patent Application No. P2001-236235A describes an instruction sequence optimization apparatus which generates an optimized code from an instruction sequence.
Japanese Patent Application No. 2004-295398A describes a compiler capable of optimizing a statement which performs an operation equal to a processing operation using a built-in function defined by a user, to be in a machine language corresponding to the built-in function defined by the user (paragraph 0009).
Japanese Patent No. 05-324313A describes that, in a data processing apparatus capable of executing a decimal operation instruction, unpack-format and pack-format decimal data are converted to fixed-point-number-format binary data when a central processing unit executes an instruction (claim 1).